#include <iostream>
#include <cstdio>
#define IS_YEAR(x) x % 100 != 0 && x % 4 == 0 || x % 400 == 0 ? 1 : 0

int day_of_month[13][2] = {
    0, 0, 
    31, 31,
    28, 29,
    31, 31,
    30, 30,
    31, 31,
    30, 30,
    31, 31,
    31, 31,
    30, 30,
    31, 31,
    30, 30,
    31, 31
};

class date{
public:
    int day;
    int month;
    int year;
    void next_day(){
    	day++;
        if (day > day_of_month[month][IS_YEAR(year)]){
            day = 1;
            month++;
            if (month > 12){
                month = 1;
                year++;
            }
        }
    }
};

int buf[5001][13][32]; // pre-storage
int abs(int x); // may have conflicts with the 'abs' in <cstdio>

int main(int argc, char const *argv[]){
    date tmp;
    int count = 0;
    // initial date to 0000.01.01
    tmp.day = 1;
    tmp.month = 1;
    tmp.year = 0; 

    while(tmp.year != 5001){
        buf[tmp.year][tmp.month][tmp.day] = count;
        tmp.next_day();
        count++;
    }
    int d1, m1, y1;
    int d2, m2, y2;
    while(scanf("%4d%2d%2d", &y1, &m1, &d1) != EOF){
        scanf("%4d%2d%2d", &y2, &m2, &d2);
        printf("%d\n", abs(buf[y2][m2][d2] - buf[y1][m1][d1]) + 1);
    }
    return 0;
}

int abs(int x){
    return x < 0 ? -x : x;
}
